Device and method for coding video data

ABSTRACT

A method of decoding a bitstream by an electronic device is provided. An image frame of the bitstream is received, and a block unit having a block width and a block height is determined from the received image frame. The electronic device determines whether a geometric partitioning mode is disabled for the block unit based on a comparison between the block width and the block height. The block unit is divided to generate a plurality of sub-blocks predicted by different merge candidates of the block unit when the geometric partitioning mode is enabled and applied on the block unit. The predicted block is generated by predicting block unit based on a prediction mode different from the geometric partitioning mode when the geometric partitioning mode is disabled for the block unit. The block unit is reconstructed based on the predicted block.

CROSS-REFERENCE TO RELATED APPLICATION(S)

This application is a continuation application of U.S. patentapplication Ser. No. 17/138,795, filed on Dec. 30, 2020, entitled“Device and Method for Coding Video Data” (hereinafter referred to as“the '795 application”), which claims the benefit of and priority toU.S. Provisional Patent Application Ser. No. 62/955,228, filed on Dec.30, 2019, entitled “Adjustment of Partition Candidates for GeometricPartition Prediction” (hereinafter referred to as “the '228provisional”). The disclosures of the '795 application and the '228provisional are hereby incorporated fully by reference into the presentdisclosure.

FIELD

The present disclosure is generally related to video coding, andspecifically, to techniques for determining, based on a ratio valuebetween a width and a height of a block unit in an image frame, whetherthe block unit is predicted by a geometric partitioning mode.

BACKGROUND

Geometric partitioning mode is a coding tool in a video coding method.In the geometric partitioning mode, an encoder may select two of aplurality of merge candidates for predicting a block unit in an imageframe and provide two merge indices into a bitstream for a decoder torecognize the selected merge candidates.

The encoder and the decoder may split the block unit in the image framealong a partition line to generate a plurality of sub-blocks when thegeometric partitioning mode is applied on the block unit. Some of thesub-blocks may be predicted based on only one of the two mergecandidates, and other of the sub-blocks may be predicted based on bothof the two merge candidates. Therefore, the encoder needs to select aprediction result of the block unit from a plurality of candidateresults including a geometric result when the encoder tries a pluralityof prediction modes including the geometric partitioning mode forpredicting the block unit.

However, it is too complex for the encoder to predict the block unit inthe geometric partitioning mode to generate the geometric result byselecting the partition line from a plurality of candidate lines andselecting the two merge candidates from the plurality of mergecandidates. Therefore, in order to decrease the complexity of theencoding process, it may be important for the encoder to restrict theusage of the geometric partitioning mode for predicting the block unit.The decoder also needs to know how to determine that the geometricpartitioning mode is disabled.

SUMMARY

The present disclosure is directed to a device and method fordetermining whether the geometric partitioning mode is applied on ablock unit based on a comparison between a width and a height of theblock unit.

In a first aspect of the present disclosure, a method for decoding abitstream and an electronic device for performing the method areprovided. The method comprises receiving an image frame of thebitstream; determining a block unit having a block width and a blockheight from the received image frame; determining whether a geometricpartitioning mode is disabled for the block unit based on a comparisonbetween the block width and the block height, the block unit beingdivided to generate a plurality of sub-blocks predicted by differentmerge candidates of the block unit when the geometric partitioning modeis enabled and applied on the block unit; generating the predicted blockby predicting the block unit based on a prediction mode different fromthe geometric partitioning mode when the geometric partitioning mode isdisabled for the block unit; and reconstructing the block unit based onthe predicted block.

In a second aspect of the present disclosure, a method for decoding abitstream and an electronic device for performing the method areprovided. The method comprises receiving an image frame of thebitstream; determining a block unit having a block width and a blockheight from the received image frame; determining a comparison betweenthe block width and the block height; generating a predicted block bypredicting the block unit based on a first prediction mode differentfrom a geometric partitioning mode when the comparison between the blockwidth and the block height indicates that a ratio value between theblock width and the block height is greater than or equal to a thresholdvalue, the block unit being divided to generate a plurality ofsub-blocks each predicted by different merge candidates of the blockunit when the geometric partitioning mode is enabled and applied on theblock unit; and reconstructing the block unit based on the predictedblock.

BRIEF DESCRIPTION OF THE DRAWINGS

Aspects of the present disclosure are best understood from the followingdetailed disclosure and the corresponding figures. Various features arenot drawn to scale and dimensions of various features may be arbitrarilyincreased or reduced for clarity of discussion.

FIG. 1 illustrates a block diagram of a system configured to encode anddecode video data according to an example implementation of the presentdisclosure.

FIG. 2 illustrates a block diagram of the decoder module of the secondelectronic device illustrated in FIG. 1 according to an exampleimplementation of the present disclosure.

FIG. 3 illustrates a flowchart of a method for encoding and decodingvideo data by an electronic device according to an exampleimplementation of the present disclosure.

FIG. 4A-FIG. 4C are schematic illustrations of a block unit havingdifferent block sizes, according to example implementations of thepresent disclosure.

FIG. 5A and FIG. 5B are schematic illustrations of a block unit havingdifferent sub-blocks separated based on a partition line, according toexample implementations of the present disclosure

FIG. 6 illustrates a block diagram of the encoder module of the firstelectronic device illustrated in FIG. 1 according to an exampleimplementation of the present disclosure.

DESCRIPTION

The following disclosure contains specific information pertaining toexample implementations in the present disclosure. The figures and thecorresponding detailed disclosure are directed to exampleimplementations. However, the present disclosure is not limited to theseexample implementations. Other variations and implementations of thepresent disclosure will occur to those skilled in the art.

Unless noted otherwise, like or corresponding elements among the figuresmay be indicated by like or corresponding reference designators. Thefigures and illustrations in the present disclosure are generally not toscale and are not intended to correspond to actual relative dimensions.

For the purpose of consistency and ease of understanding, like featuresare identified (although, in some examples, not illustrated) byreference designators in the exemplary figures. However, the features indifferent implementations may differ in other respects and shall not benarrowly confined to what is illustrated in the figures.

The disclosure uses the phrases “in one implementation,” or “in someimplementations,” may refer to one or more of the same or differentimplementations. The term “coupled” is defined as connected, whetherdirectly or indirectly, through intervening components and is notnecessarily limited to physical connections. The term “comprising” means“including, but not necessarily limited to” and specifically indicatesopen-ended inclusion or membership in the so-described combination,group, series and the equivalent.

For purposes of explanation and non-limitation, specific details such asfunctional entities, techniques, protocols, and standards are set forthfor providing an understanding of the disclosed technology. In otherexamples, detailed disclosure of well-known methods, technologies,systems and architectures are omitted so as not to obscure the presentdisclosure with unnecessary details.

Persons skilled in the art will immediately recognize that any disclosedcoding function(s) or algorithm(s) described in the present disclosuremay be implemented by hardware, software or a combination of softwareand hardware. Disclosed functions may correspond to modules that aresoftware, hardware, firmware, or any combination thereof.

A software implementation may include a program having computerexecutable instructions stored on computer readable medium such asmemory or other type of storage devices. For example, one or moremicroprocessors or general-purpose computers with communicationprocessing capability may be programmed with executable instructions andperform the disclosed function(s) or algorithm(s).

The microprocessors or general-purpose computers may be formed ofapplication-specific integrated circuitry (ASIC), programmable logicarrays, and/or using one or more digital signal processors (DSPs).Although some of the disclosed implementations are oriented to softwareinstalled and executing on computer hardware, alternativeimplementations implemented as firmware or as hardware or combination ofhardware and software are well within the scope of the presentdisclosure. The computer readable medium includes but is not limited torandom-access memory (RAM), read-only memory (ROM), erasableprogrammable read-only memory (EPROM), electrically erasableprogrammable read-only memory (EEPROM), flash memory, compact discread-only memory (CD ROM), magnetic cassettes, magnetic tape, magneticdisk storage, or any other equivalent medium capable of storingcomputer-readable instructions.

FIG. 1 illustrates a block diagram of a system configured to encode anddecode video data according to an example implementation of the presentdisclosure. The system 100 includes a first electronic device 110, asecond electronic device 120, and a communication medium 130.

The first electronic device 110 may be a source device including anydevice configured to encode video data and transmit encoded video datato the communication medium 130. The second electronic device 120 may bea destination device including any device configured to receive encodedvideo data via the communication medium 130 and to decode encoded videodata.

In at least one implementation, the first electronic device 110 maycommunicate via wire or wirelessly with the second electronic device 120via the communication medium 130. The first electronic device 110 mayinclude a source module 112, an encoder module 114, and a firstinterface 116. The second electronic device 120 may include a displaymodule 122, a decoder module 124, and a second interface 126. The firstelectronic device 110 may be a video encoder and the second electronicdevice 120 may be a video decoder.

In at least one implementation, the first electronic device 110 and/orthe second electronic device 120 may be a mobile phone, a tablet, adesktop, a notebook, or other electronic devices. FIG. 1 illustrates oneexample of the first electronic device 110 and the second electronicdevice 120. The first electronic device 110 and second electronic device120 may include more or less components than illustrated or have adifferent configuration of the various illustrated components.

In at least one implementation, the source module 112 may include avideo capture device to capture new video, a video archive to storepreviously captured video, and/or a video feed interface to receivevideo from a video content provider. The source module 112 may generatecomputer graphics-based data as the source video or generate acombination of live video, archived video, and computer-generated videoas the source video. The video capture device may be a charge-coupleddevice (CCD) image sensor, a complementary metal-oxide-semiconductor(CMOS) image sensor, or a camera.

In at least one implementation, the encoder module 114 and the decodermodule 124 may each be implemented as any of a variety of suitableencoder/decoder circuitry such as one or more microprocessors, a centralprocessing unit (CPU), a graphic processing unit (GPU), a system on chip(SoC), digital signal processors (DSPs), application-specific integratedcircuits (ASICs), field programmable gate arrays (FPGAs), discretelogic, software, hardware, firmware or any combinations thereof. Whenimplemented partially in software, a device may store the program havinginstructions for the software in a suitable, non-transitorycomputer-readable medium and execute the instructions in hardware usingone or more processors to perform the disclosed methods. In at least oneimplementation, each of the encoder module 114 and the decoder module124 may be included in one or more encoders or decoders, any of whichmay be integrated as part of a combined encoder/decoder (CODEC) in adevice.

In at least one implementation, the first interface 116 and the secondinterface 126 may utilize customized protocols or follow existingstandards or de facto standards including, but not limited to, Ethernet,IEEE 802.11 or IEEE 802.15 series, Wireless USB or telecommunicationstandards including, but not limited to, Global System for MobileCommunications (GSM), Code-Division Multiple Access 2000 (CDMA2000),Time Division Synchronous Code Division Multiple Access (TD-SCDMA),Worldwide Interoperability for Microwave Access (WiMAX), ThirdGeneration Partnership Project Long-Term Evolution (3GPP-LTE) orTime-Division LTE (TD-LTE). In at least one implementation, the firstinterface 116 and the second interface 126 may each include any deviceconfigured to transmit and/or store a compliant video bitstream via thecommunication medium 130 and to receive the compliant video bitstreamvia the communication medium 130.

In at least one implementation, the first interface 116 and the secondinterface 126 may include a computer system interface that enables acompliant video bitstream to be stored on a storage device or to bereceived from the storage device. For example, the first interface 116and the second interface 126 may include a chipset supporting PeripheralComponent Interconnect (PCI) and Peripheral Component InterconnectExpress (PCIe) bus protocols, proprietary bus protocols, UniversalSerial Bus (USB) protocols, I2C, or any other logical and physicalstructure that may be used to interconnect peer devices.

In at least one implementation, the display module 122 may include adisplay using liquid crystal display (LCD) technology, plasma displaytechnology, organic light emitting diode (OLED) display technology, orlight emitting polymer display (LPD) technology with other displaytechnologies used in other implementations. The display module 122 mayinclude a high-definition display or an ultra-high-definition display.

FIG. 2 illustrates a block diagram of the decoder module 124 of thesecond electronic device 120 illustrated in FIG. 1 according to anexample implementation of the present disclosure. The decoder module 124includes an entropy decoder (e.g., entropy decoding unit 2241), aprediction processor (e.g., prediction process unit 2242), an inversequantization/inverse transform processor (e.g., inversequantization/inverse transform unit 2243), a summer (e.g., summer 2244),a filter (e.g., filtering unit 2245), and a decoded picture buffer(e.g., decoded picture buffer 2246). The prediction process unit 2242further includes an intra prediction processor (e.g., intra predictionunit 22421) and an inter prediction processor (e.g., inter predictionunit 22422). The decoder module 124 receives a bitstream and decodes thebitstream to output decoded video.

The entropy decoding unit 2241 may receive the bitstream including aplurality of syntax elements from the second interface 126 in FIG. 1 andperform a parsing operation on the bitstream to extract syntax elementsfrom the bitstream. As part of the parsing operation, the entropydecoding unit 2241 may entropy decode the bitstream to generatequantized transform coefficients, quantization parameters, transformdata, motion vectors, intra modes, partition information, and othersyntax information.

In at least one implementation, the entropy decoding unit 2241 mayperform context adaptive variable length coding (CAVLC), contextadaptive binary arithmetic coding (CABAC), syntax-based context-adaptivebinary arithmetic coding (SBAC), probability interval partitioningentropy (PIPE) coding or another entropy coding technique to generatethe quantized transform coefficients. In at least one implementation,the entropy decoding unit 2241 may provide the quantized transformcoefficients, the quantization parameters, and the transform data to theinverse quantization/inverse transform unit 2243 and provide the motionvectors, the intra modes, the partition information, and other syntaxinformation to the prediction process unit 2242.

In at least one implementation, the prediction process unit 2242 mayreceive syntax elements such as motion vectors, intra modes, partitioninformation, and other syntax information from the entropy decoding unit2241. The prediction process unit 2242 may receive the syntax elementsincluding the partition information and divide image frames according tothe partition information.

In at least one implementation, each of the image frames may be dividedinto at least one image block according to the partition information.The at least one image block may include a luminance block forreconstructing a plurality of luminance samples and at least onechrominance block for reconstructing a plurality of chrominance samples.The luminance block and the at least one chrominance block may befurther divided to generate macroblocks, coding tree units (CTUs),coding blocks (CBs), sub-divisions thereof, and/or another equivalentcoding unit.

In at least one implementation, during the decoding process, theprediction process unit 2242 may receive predicted data including theintra mode or the motion vector for a current image block of a specificone of the image frames. The current image block may be the luminanceblock or one of the chrominance blocks in the specific image frame.

In at least one implementation, the intra prediction unit 22421 mayperform intra-predictive coding of a current block unit relative to oneor more neighboring blocks in the same frame as the current block unitbased on syntax elements related to the intra mode in order to generatea predicted block. The intra mode may specify the location of referencesamples selected from the neighboring blocks within the current frame.In at least one implementation, the intra prediction unit 22421 mayreconstruct a plurality of chroma components of the current block unitbased on a plurality of luma components of the current block unit whenthe chroma components are reconstructed by the prediction process unit2242.

In at least one implementation, the intra prediction unit 22421 mayreconstruct a plurality of chroma components of the current block unitbased on the plurality of luma components of the current block unit whenthe luma components of the current block are reconstructed by theprediction process unit 2242.

In at least one implementation, the inter prediction unit 22422 mayperform inter-predictive coding of the current block unit relative toone or more blocks in one or more reference image blocks based on syntaxelements related to the motion vector in order to generate the predictedblock.

In at least one implementation, the motion vector may indicate adisplacement of the current block unit within the current image blockrelative to a reference block unit within the reference image block. Thereference block unit is a block determined to closely match the currentblock unit.

In at least one implementation, the inter prediction unit 22422 mayreceive the reference image block stored in the decoded picture buffer2246 and reconstruct the current block unit based on the receivedreference image blocks.

In at least one implementation, the inverse quantization/inversetransform unit 2243 may apply inverse quantization and inversetransformation to reconstruct the residual block in the pixel domain.The inverse quantization/inverse transform unit 2243 may apply inversequantization to the residual quantized transform coefficient to generatea residual transform coefficient and then apply inverse transformationto the residual transform coefficient to generate the residual block inthe pixel domain.

In at least one implementation, the inverse transformation may beinversely applied by the transformation process such as discrete cosinetransform (DCT), discrete sine transform (DST), adaptive multipletransform (AMT), mode-dependent non-separable secondary transform(MDNSST), hypercube-givens transform (HyGT), signal dependent transform,Karhunen-Loeve transform (KLT), wavelet transform, integer transform,sub-band transform or a conceptually similar transform.

In at least one implementation, the inverse transformation may convertthe residual information from a transform domain, such as a frequencydomain, back to the pixel domain. In at least one implementation, thedegree of inverse quantization may be modified by adjusting aquantization parameter. The summer 2244 adds the residual block to thepredicted block from the prediction process unit 2242 to produce areconstructed block.

In at least one implementation, the summer 2244 adds the reconstructedresidual block to the predicted block provided from the predictionprocess unit 2242 to produce a reconstructed block.

In at least one implementation, the filtering unit 2245 may include adeblocking filter, a sample adaptive offset (SAO) filter, a bilateralfilter, and/or an adaptive loop filter (ALF) to remove blockingartifacts from the reconstructed block. Additional filters (in loop orpost loop) may also be used in addition to the deblocking filter, theSAO filter, the bilateral filter and the ALF. Such filters are notexplicitly illustrated for brevity but may filter the output of thesummer 2244.

The filtering unit 2245 may output the decoded video to the displaymodule 122 or other video receiving unit after the filtering unit 2245performs the filtering process for the reconstructed blocks of thespecific image frame.

In at least one implementation, the decoded picture buffer 2246 may be areference picture memory that stores the reference block for use by theprediction process unit 2242 in decoding the bitstream (in inter codingmodes). The decoded picture buffer 2246 may be formed by any of avariety of memory devices such as dynamic random-access memory (DRAM),including synchronous DRAM (SDRAM), magneto-resistive RAM (MRAM),resistive RAM (RRAM), or other types of memory devices.

In at least one implementation, the decoded picture buffer 2246 may beon-chip with other components of the decoder module 124 or off-chiprelative to those components.

FIG. 3 illustrates a flowchart of a method 300 for encoding and decodingvideo data by an electronic device according to an exampleimplementation of the present disclosure. The method 300 is an exampleonly as there are a variety of ways to perform the method.

The method 300 for decoding a bitstream and reconstructing a block unitmay be performed using the configurations illustrated in FIG. 1 and FIG.2 and various elements of these figures are referenced with regard tothe method 300. Each block illustrated in FIG. 3 may represent one ormore processes, methods, or subroutines performed.

The order of blocks in FIG. 3 is illustrative only and may change.Additional blocks may be added or less blocks may be utilized withoutdeparting from the present disclosure.

At block 310, the decoder module 124 receives an image frame of videodata. The video data may be a bitstream.

With reference to FIG. 1 and FIG. 2, the second electronic device 120may receive the bitstream from an encoder, such as the first electronicdevice 110, or other video providers via the second interface 126. Thesecond interface 126 may provide the bitstream to the decoder module124.

In at least one implementation, the entropy decoding unit 2241 maydecode the bitstream to determine a plurality of prediction indicationsand a plurality of partitioning indications for the image frame and thedecoder module 124 may further reconstruct the image frame based on theprediction indications and the partitioning indications. The predictionindications and the partitioning indications may include a plurality offlags and a plurality of indices.

At block 320, the decoder module 124 determines a block unit having ablock width and a block height from the received video data. Withfurther reference to FIG. 1 and FIG. 2, the decoder module 124 maydivide the image frame to determine the block unit according to thepartition indications included in the bitstream. For example, thedecoder module 124 may divide the image frames to generate a pluralityof coding tree units and may further divide one of the coding tree unitsto determine the block unit according to the partition indications(e.g., based on a video coding standard).

FIG. 4A-FIG. 4C are schematic illustrations of a block unit havingdifferent block sizes according to example implementations of thepresent disclosure. In at least one implementation, a block size of theblock unit may include a block height Hb and a block width Wb. Forexample, the block size of the block unit 410 includes the block heightH410 and the block width W410, the block size of the block unit 430includes the block height H430 and the block width W430, and the blocksize of the block unit 450 includes the block height H450 and the blockwidth W450. In the implementation, the block height H410 may be equal tothe block width W410, the block width W430 may be equal to 8×H430 andthe block height H450 may be equal to 4×W450.

At block 330, the decoder module 124 determines a comparison between theblock width and the block height. With further reference to FIG. 1 andFIG. 2, the decoder module 124 may determine the comparison between theblock width and the block height based on an inequality.

For example, a ratio value R between the block width Wb and the blockheight Hb may be greater than or equal to a threshold value T (i.e.,R≥T). In one implementation, the ratio value R between the width Wb andthe block height Hb may be less than the threshold value T (i.e., R<T).In another implementation, the ratio value R between the width Wb andthe block height Hb may be greater than the threshold value T (i.e.,R>T). In the other implementation, the ratio value R between the widthWb and the block height Hb may be less than or equal to the thresholdvalue T (i.e., R<T).

In at least one implementation, the decoder module 124 may determine aratio parameter RP computed based on the block width Wb and the blockheight Hb. In at least one implementation, a first ratio parameter RP1may be computed based on division. In one implementation, the firstratio parameter RP1 may be computed by dividing the block width Wb bythe block height Hb (i.e., RP1=Wb/Hb) when the block width Wb is greaterthan or equal to the block height Hb. The first ratio parameter RP1 maybe computed by dividing the block height Hb by the block width Wb (i.e.,RP1=Hb/Wb) when the block width Wb is less than the block height Hb. Inother implementation, the first ratio parameter RP1 may be computed bydividing the block width Wb by the block height Hb, when the block widthWb is greater than the block height Hb. Therefore, the first ratioparameter RP1 may be computed by dividing the block height Hb by theblock width Wb, when the block width Wb is less than or equal to theblock height Hb.

In at least one implementation, the second ratio parameter RP2 may becomputed based on the block width Wb and the block height Hb by alogarithmic equation. In the implementation, one of the first ratioparameter RP1 and the second ratio parameter RP2 computed by differentformulas may be set as the ratio parameter RP of the block unit. In atleast one implementation, the second ratio parameter RP2 may be equal toan absolute value of a difference value generated by subtracting abase-2 logarithm of the block height from a base-2 logarithm of theblock width (i.e., RP2=abs (log 2 Wb−log 2 Hb)). In other words, thesecond ratio parameter RP2 may be equal to the absolute value of abase-2 logarithm of a quotient value, and the quotient value isgenerated by dividing the block width Wb by the block height Hb ordividing the block height Hb by the block width Wb (i.e., RP2=abs (log 2Wb−log 2 Hb)=abs (log 2 (Wb/Hb))=abs (log 2 (Hb/Wb))). The first ratioparameter RP1 may be equal to two to the power of the second ratioparameter RP2.

In at least one implementation, the decoder module 124 may compare theratio parameter RP with a ratio threshold RT. The decoder module 124 maydetermine that the comparison indicates that the ratio value R isgreater than the threshold value T when the ratio parameter RP isgreater than the ratio threshold RT. The decoder module 124 maydetermine that the comparison indicates that the ratio value R is equalto the threshold value T when the ratio parameter RP is equal to theratio threshold RT. The decoder module 124 may determine that thecomparison indicates that the ratio value R is less than the thresholdvalue T when the ratio parameter RP is less than the ratio threshold RT.

In at least one implementation, the decoder module 124 may compare theratio parameter RP with a first ratio threshold RT1 when the first ratioparameter RP1 is set as the ratio parameter RP. In one implementation,the decoder module 124 may determine that the comparison indicates thatthe ratio value R is greater than or equal to the threshold value T whenthe first ratio parameter RP1 is greater than or equal to the firstratio threshold RT1. The decoder module 124 may determine that thecomparison indicates that the ratio value R is less than the thresholdvalue T when the first ratio parameter RP1 is less than the first ratiothreshold RT1. In other implementation, the decoder module 124 maydetermine that the comparison indicates that the ratio value R is lessthan or equal to the threshold value T when the first ratio parameterRP1 is less than or equal to the first ratio threshold RT1. In at leastone implementation, the first ratio threshold RT1 may be a positiveinteger.

In at least one implementation, the first ratio threshold RT1 may beequal to two to the power of n, and the number n is a positive integer.The first ratio threshold RT1 may be preset to 1, 2, 4 or 8. Forexample, the first ratio parameter RP1 of the block unit 410 equal to 1and the first ratio parameter RP1=H450/W450 of the block unit 450 equalto 4 are less than the first ratio threshold RT1 when the first ratiothreshold RT1 is equal to 8. The first ratio parameter RP1=W430/H430 ofthe block unit 430 equal to 8 is not less than the first ratio thresholdRT1 when the first ratio threshold RT1 is equal to 8.

In at least one implementation, the decoder module 124 may compare theratio parameter RP with a second ratio threshold RT2 when the secondratio parameter RP2 is set as the ratio parameter RP. The decoder module124 may determine that the comparison indicates that the ratio value Ris greater than or equal to the threshold value T when the second ratioparameter RP2 is greater than or equal to the second ratio thresholdRT2. The decoder module 124 may determine that the comparison indicatesthat the ratio value R is less than the threshold value T when thesecond ratio parameter RP2 is less than the second ratio threshold RT2.The decoder module 124 may determine that the comparison indicates thatthe ratio value R is less than or equal to the threshold value T whenthe second ratio parameter RP2 is less than or equal to the second ratiothreshold RT2.

In at least one implementation, the second ratio threshold RT2 may be apositive integer. The second ratio threshold RT2 may be preset to 1, 2,3 or 4. For example, the second ratio parameter RP2 of the block unit410 equal to 0 and the second ratio parameter RP2 of the block unit 450equal to 2 are less than the second ratio threshold RT2 when the secondratio threshold RT2 is equal to 3. The second ratio parameter RP2 of theblock unit 430 equal to 3 is not less than the second ratio thresholdRT2 when the second ratio threshold RT2 is equal to 3.

In at least one implementation, the first ratio threshold RT1 may beequal to two to the power of the second ratio threshold RT2 since thefirst ratio parameter RP1 is equal to two to the power of the secondratio parameter RP2. Therefore, the result of the comparison may beunchanged when the decoder module 124 changes the comparison from afirst inequality RP1<RT1 to a second inequality RP2<RT2.

In at least one implementation, the decoder module 124 may compare theblock width Wb with a first magnified value N1 generated from the blockheight Hb and compare the block height Hb with a second magnified valueN2 generated from the block width Wb when the decoder module 124determines the comparison between the block width Wb and the blockheight Hb. The first magnified value N1 may be computed by multiplyingthe block height Hb by the threshold value T, and the second magnifiedvalue N2 may be computed by multiplying the block width Wb by thethreshold value T (i.e., N1=T×Hb and N2=T×Wb).

In at least one implementation, the decoder module 124 may determine thecomparison indicates that the ratio value R is less than the thresholdvalue T when the block width Wb is less than the first magnified valueN1 and the block height Hb is less than the second magnified value N2.The decoder module 124 may determine the comparison indicates that theratio value R is greater than or equal to the threshold value T when theblock width Wb is greater than or equal to the first magnified value N1.The decoder module 124 may determine the comparison indicates that theratio value R is greater than or equal to the threshold value T when theblock height Hb is greater than or equal to the second magnified valueN2.

In at least one implementation, the threshold value T may be equal tothe first ratio threshold RT1 when the decoder module 124 determines thecomparison based on the first magnified value N1 and the secondmagnified value N2. The decoder module 124 may determine the comparisonbased on a third inequality Wb<N1=RT1×Hb and a fourth inequalityHb<N2=RT1×Wb.

In at least one implementation, the first ratio threshold RT1 may bepreset to 1, 2, 4 or 8. Therefore, the threshold value T may be presetto 1, 2, 4 or 8 when the decoder module 124 determines the comparisonbased on the first magnified value N1 and the second magnified value N2.In at least one implementation, a first division value Hb/Wb may be lessthan 1 when the block width Wb is greater than the block height Hb.Therefore, the first division value Hb/Wb is also less than thethreshold value T and the fourth inequality Hb<RT1×Wb is true when theblock width Wb is greater than the block height Hb.

In other words, the comparison may only be influenced by the thirdinequality Wb <RT1×Hb when the block width Wb is greater than the blockheight Hb. Therefore, the comparison determined based on the firstinequality RP1=Wb/Hb<RT1 is identical to the comparison determined basedon the third inequality Wb<N1=RT1×Hb and the fourth inequalityHb<N2=RT1×Wb when the block width Wb is greater than the block heightHb.

In another implementation, a second division value Wb/Hb may be lessthan 1 when the block width Wb is less than the block height Hb.Therefore, the second division value Wb/Hb is also less than thethreshold value T and the third inequality Wb<RT1×Hb is true when theblock width Wb is less than the block height Hb and the threshold valueT is preset to 1, 2, 4 or 8.

In other words, the comparison may only be influenced by the fourthinequality Hb<RT1×Wb when the block width Wb is less than the blockheight Hb. Therefore, the comparison determined based on the firstinequality RP1=Hb/Wb<RT1 is identical to the comparison determined basedon the third inequality Wb<N1=RT1×Hb and the fourth inequalityHb<N2=RT1×Wb when the block width Wb is less than the block height Hb.

In other implementation, the first division value and the seconddivision value may be equal to 1 when the block width Wb is equal to theblock height Hb. Therefore, the first division value and the seconddivision value is less than the threshold value T and the thirdinequality and the fourth inequality is true when the block width Wb isequal to the block height Hb and the threshold value T is preset to 2, 4or 8. Thus, the comparison determined based on the first inequalityRP1=Hb/Wb<RT1 is identical to the comparison determined based on thethird inequality Wb<N1=RT1×Hb and the fourth inequality Hb<N2=RT1×Wbwhen the block width Wb is equal to the block height Hb and thethreshold value T is preset to 2, 4 or 8.

At block 340, the decoder module 124 determines whether a geometricpartitioning mode is disabled for the block unit based on thecomparison. The method 300 may proceed to block 350 when the decodermodule 124 determines that the geometric partitioning mode is disabledfor the block unit. The method may proceed to block 360 when the decodermodule 124 determines the geometric partitioning mode is enabled for theblock unit.

With further reference to FIG. 1 and FIG. 2, the decoder module 124 maydetermine that the geometric partitioning mode is disabled for the blockunit when the comparison indicates that the ratio value R between theblock width Wb and the block height Hb is greater than or equal to thethreshold value T. The decoder module 124 may determine that thegeometric partitioning mode is enabled for the block unit when thecomparison indicates that the ratio value R between the block width Wband the block height Hb is less than the threshold value T.

In at least one implementation, the decoder module 124 may determine thecomparison between the block width and the block height to restrict theusage of the geometric partitioning mode. When the block unit is toonarrow, the prediction results of different neighboring partition linesmay be similar to each other. The block unit may be further dividedalong a horizontal direction or a vertical direction to generate twoblock units to be predicted respectively when the block unit is toonarrow.

Therefore, the geometric partitioning mode may be disabled when theblock unit is too narrow. For example, the geometric partitioning modemay be disabled when the block width is greater than or equal to T timesthe block height, or the block height is greater than or equal to Ttimes the block width. In at least one implementation, the thresholdvalue T may be equal to 2, 4 or 8.

In at least one implementation, the geometric partitioning mode may bedisabled for the block unit when the decoder module 124 determines thatthe first ratio parameter RP1 is greater than or equal to the firstratio threshold RT1. The geometric partitioning mode may be enabled forthe block unit when the decoder module 124 determines that the firstratio parameter RP1 is less than the first ratio threshold RT1.

For example, the first ratio threshold RT1 may be equal to eight.Therefore, the geometric partitioning mode may be disabled for the blockunit when the first ratio parameter RP1 of the block unit is greaterthan or equal to 8.

In a general geometric partitioning mode, the block width Wb and theblock height Hb are greater than or equal to 8. Therefore, the geometricpartitioning mode may not be applied on the block unit having the blocksize 64×8 or 8×64 when the first ratio threshold RT1 is equal to eight.The geometric partitioning mode may not be applied on the block unithaving the block size 64×8, 64×16, 32×8, 8×64, 16×64 or 8×32 when thefirst ratio threshold RT1 is equal to four.

In at least one implementation, the geometric partitioning mode may bedisabled for the block unit when the decoder module 124 determines thatthe second ratio parameter RP2 is greater than or equal to the secondratio threshold RT2. The geometric partitioning mode may be enabled forthe block unit when the decoder module 124 determines that the secondratio parameter RP2 is less than the second ratio threshold RT2.

For example, the geometric partitioning mode may not be applied on theblock unit having the block size 64×8 or 8×64 when the second ratiothreshold RT2 is equal to three. The geometric partitioning mode may notbe applied on the block unit having the block size 64×8, 64×16, 32×8,8×64, 16×64 or 8×32 when the second ratio threshold RT2 is equal to two.

In at least one implementation, the geometric partitioning mode may bedisabled for the block unit when the decoder module 124 determines thatthe block width Wb is greater than or equal to the first magnified valueN1. In another implementation, the geometric partitioning mode may bedisabled for the block unit when the decoder module 124 determines thatthe block height Hb is greater than or equal to the second magnifiedvalue N2. The geometric partitioning mode may be enabled for the blockunit when the block width Wb is less than the first magnified value N1and the block height Hb is less than the second magnified value N2.

For example, the geometric partitioning mode may not be applied on theblock unit having the block size 64×8 or 8×64 when the threshold value Tis equal to eight. In other words, the geometric partitioning mode maynot be applied on the block unit having the block size 64×8 or 8×64 whenthe block width Wb is greater than or equal to the first magnified value8×Hb or block height Hb is greater than or equal to the second magnifiedvalue 8×Wb. The geometric partitioning mode may not be applied on theblock unit having the block size 64×8, 64×16, 32×8, 8×64, 16×64 or 8×32when the block width Wb is greater than or equal to the first magnifiedvalue 4×Hb or block height Hb is greater than or equal to the secondmagnified value 4×Wb.

At block 350, the decoder module 124 predicts the block unit by using afirst prediction mode different from the geometric partitioning mode togenerate a predicted block. With further reference to FIG. 1 and FIG. 2,the decoder module 124 may select the first prediction mode and predictthe block unit based on the first prediction mode to generate thepredicted block when the geometric partitioning mode is disabled for theblock unit. The decoder module 124 may predict the block unit based onthe first prediction mode to generate the predicted block when thecomparison indicates that the ratio value R between the block width Wband the block height Hb is greater than or equal to the threshold valueT.

In at least one implementation, the first prediction mode may beselected from a plurality of option modes. Each of the option modes isdifferent from the geometric partitioning mode.

In at least one implementation, the option modes may be determined forselecting the first prediction mode by a first merge index. Therefore,the first prediction mode may be the one of the option modes selectedbased on the first merge index.

In the implementation, the first merge index may indicate the firstprediction mode included in a merge candidate list. In at least oneimplementation, the option modes may be a plurality of merge candidatemodes in the merge candidate list determined from a plurality of spatialmotion prediction modes of a plurality of neighboring blocks neighboringthe block unit, a plurality of temporal motion prediction modes of aplurality of collocated blocks, history-based motion prediction modesstored in a first-in-first-out (FIFO) table, a plurality of pair-wiseaverage motion prediction modes, and a zero motion mode.

In at least one implantation, the first prediction mode may indicatefirst motion information having a first reference frame and a firstreference vector V0. The first reference frame may be selected from aplurality of reference lists. In at least one implementation, the firstmotion information may include a first list flag for determining one ofthe reference lists to select the first reference frame. In at least oneimplementation, a plurality of block components in the block unit may bepredicted based on the first reference vector V0 and the first referenceframe.

At block 360, the decoder module 124 predicts the block unit by using asecond prediction mode selected from a plurality of candidate modesincluding the geometric partitioning mode to generate the predictedblock. With further reference to FIG. 1 and FIG. 2, the decoder module124 may select the second prediction mode and predict the block unitbased on the second prediction mode to generate the predicted block whenthe geometric partitioning mode is enabled for the block unit. Thedecoder module 124 may predict the block unit based on the secondprediction mode to generate the predicted block when the comparisonindicates the ratio value R is less than the threshold value T.

In at least one implementation, the second prediction mode may beselected from the candidate modes. In the implementation, the candidatemodes may include the geometric partitioning mode. In oneimplementation, the candidate modes may include the option modes and thegeometric partitioning mode.

In at least one implementation, the decoder module 124 may determine apartition index, a second merge index and a third merge index of theblock unit from the bitstream when the geometric partitioning mode isapplied on the block unit for predicting the block unit. FIG. 5A andFIG. 5B are schematic illustrations of a block unit having differentsub-blocks separated based on a partition line, according to exampleimplementations of the present disclosure. The decoder module 124 maydivide the block unit 510 to generate a first sub-block 512, a secondsub-block 514 and a third sub-block 516 based on a partition line 511determined from the partition index.

In at least one implementation, the partition index may indicate thepartition line 511 of the block unit 510. In at least oneimplementation, the partition index may indicate a partition angle indexand a partition distance index. The partition angle index may indicate asplit angle of the partition line, and the partition distance index mayindicate a split distance between the partition line and a center pointof the block unit.

Therefore, the decoder module 124 may determine the partition line basedon the split angle and the split distance indicated by the partitionindex. The bitstream may directly include the partition angle index andthe partition distance index.

In at least one implementation, the decoder module 124 may predict theplurality of sub-blocks 512, 514 and 516 based on second motioninformation and third motion information determined from the mergecandidate modes by the second merge index and the third merge index. Inat least one implementation, the second motion information indicated bythe second merge index may be one of the merge candidate modes includedin the merge candidate list, and the third motion information indicatedby the third merge index may also be one of the merge candidate modesincluded in the merge candidate list. In at least one implantation, thesecond motion information may indicate a second reference frame and asecond reference vector V1, and the third motion information mayindicate a third reference frame and a third reference vector V2.

The second reference frame and the third reference frame may be selectedfrom the plurality of reference lists. In one implementation, the secondreference frame and the third reference frame may be selected from thesame one of the reference lists. In other implementations, the secondreference frame and the third reference frame may be selected fromdifferent reference lists. In at least one implementation, the referencelists may be set as L0 and L1 when the number of the reference lists maybe equal to 2.

In at least one implementation, the second motion information mayinclude a second list flag for selecting the second reference frame andthe third motion information may include a third list flag for selectingthe third motion information. In at least one implementation, the secondreference frame and the third reference frame may be selected from thesame reference list when the second list flag is equal to the third listflag. The second reference frame and the third reference frame may beselected from different reference lists when the second list flag isdifferent from the third list flag.

In at least one implementation, a plurality of first sub-blockcomponents in the first sub-block 512 may be predicted based on thesecond reference vector V1 and the second reference frame. A pluralityof second sub-block components in the second sub-block 514 may bepredicted based on the third reference vector V2 and the third referenceframe. In addition, a plurality of third sub-block components in thethird sub-block 516 may be predicted based on the second referencevector V1, the third reference vector V2, the second reference frame andthe third reference frame. The third sub-block components in the thirdsub-block 516 may be predicted by deriving a plurality of firstreference samples determined based on the second reference vector V1 andthe second reference frame and a plurality of second reference samplesdetermined based on the third reference vector V2 and the thirdreference frame and merging the second reference samples and the thirdreference samples based on a plurality of blending weights. In at leastone implementation, the blending weights may be derived based on aplurality of component distances between the partition line 511 and thethird sub-block components in the third sub-block 516.

At block 370, the decoder module 124 reconstructs the block unit basedon the predicted block. With further reference to FIG. 1 and FIG. 2, thedecoder module 124 may determine a plurality of residual components fromthe bitstream for the block unit, and add the residual components intothe predicted block to reconstruct the block unit. The decoder module222 may reconstruct all of the other block units in the image frame forreconstructing the image frame and the video.

FIG. 6 illustrates a block diagram of the encoder module 114 of thefirst electronic device illustrated in FIG. 1 according to an exampleimplementation of the present disclosure. The encoder module 114 mayinclude a prediction processor (e.g., prediction process unit 6141), atleast a first summer (e.g., first summer 6142) and a second summer(e.g., second summer 6145), a transform/quantization processor (e.g.,transform/quantization unit 6143), an inverse quantization/inversetransform processor (e.g., inverse quantization/inverse transform unit6144), a filter (e.g., filtering unit 6146), a decoded picture buffer(e.g., decoded picture buffer 6147), and an entropy encoder (e.g.,entropy encoding unit 6148). The prediction process unit 6141 of theencoder module 114 may further include a partition processor (e.g.,partition unit 61411), an intra prediction processor (e.g., intraprediction unit 61412), and an inter prediction processor (e.g., interprediction unit 61413).

The encoder module 114 may receive the source video and encode thesource video to output a bitstream. The encoder module 114 may receivesource video including a plurality of image frames and then divide theimage frames according to a coding structure. Each of the image framesmay be divided into at least one image block.

The at least one image block may include a luminance block having aplurality of luminance samples and at least one chrominance block havinga plurality of chrominance samples. The luminance block and the at leastone chrominance block may be further divided to generate macroblocks,coding tree units (CTUs), coding blocks (CBs), sub-divisions thereof,and/or another equivalent coding unit.

In at least one implementation, the encoder module 114 may performadditional sub-divisions of the source video. It should be noted thatthe disclosed implementations are generally applicable to video codingregardless of how the source video is partitioned prior to and/or duringthe encoding.

In at least one implementation, during the encoding process, theprediction process unit 6141 may receive a current image block of aspecific one of the image frames. The current image block may be theluminance block or one of the chrominance blocks in the specific imageframe.

The partition unit 61411 may divide the current image block intomultiple block units. The intra prediction unit 61412 may performintra-predictive coding of a current block unit relative to one or moreneighboring blocks in the same frame as the current block unit in orderto provide spatial prediction. The inter prediction unit 61413 mayperform inter-predictive coding of the current block unit relative toone or more blocks in one or more reference image blocks to providetemporal prediction.

In at least one implementation, the prediction process unit 6141 mayselect one of the coding results generated by the intra prediction unit61412 and the inter prediction unit 61413 based on a mode selectionmethod, such as a cost function. The mode selection method may be arate-distortion optimization (RDO) process.

The prediction process unit 6141 may determine the selected codingresult and provide a predicted block corresponding to the selectedcoding result to the first summer 6142 for generating a residual blockand to the second summer 6145 for reconstructing the encoded block unit.The prediction process unit 6141 may further provide syntax elementssuch as motion vectors, intra mode indicators, partition information,and other syntax information to the entropy encoding unit 6148.

In at least one implementation, the intra prediction unit 61412 mayintra predict the current block unit. The intra prediction unit 61412may determine an intra prediction mode directed toward a reconstructedsample neighboring the current block unit in order to encode the currentblock unit.

In at least one implementation, the intra prediction unit 61412 mayencode the current block unit using various intra prediction modes. Theintra prediction unit 61412 or the prediction process unit 6141 mayselect an appropriate intra prediction mode from the selected modes. Theintra prediction unit 61412 may encode the current block unit using across component prediction mode to predict one of the two chromacomponents of the current block unit based on the luma components of thecurrent block unit. The intra prediction unit 61412 may predict a firstone of the two chroma components of the current block unit based on thesecond of the two chroma components of the current block unit.

In at least one implementation, the inter prediction unit 61413 mayinter predict the current block unit as an alternative to the intraprediction performed by the intra prediction unit 61412. The interprediction unit 61413 may perform motion estimation to estimate motionof the current block unit for generating a motion vector.

The motion vector may indicate a displacement of the current block unitwithin the current image block relative to a reference block unit withina reference image block. The inter prediction unit 61413 may receive atleast one reference image block stored in the decoded picture buffer6147 and estimate the motion based on the received reference imageblocks to generate the motion vector.

In at least one implementation, the first summer 6142 may generate theresidual block by subtracting the prediction block determined by theprediction process unit 6141 from the original current block unit. Thefirst summer 6142 may represent the component or components that performthis subtraction.

In at least one implementation, the transform/quantization unit 6143 mayapply a transform to the residual block in order to generate a residualtransform coefficient and then quantize the residual transformcoefficients to further reduce bit rate. The transform may be one of aDCT, DST, AMT, MDNSST, HyGT, signal dependent transform, KLT, wavelettransform, integer transform, sub-band transform or a conceptuallysimilar transform.

In at least one implementation, the transform may convert the residualinformation from a pixel value domain to a transform domain, such as afrequency domain. The degree of quantization may be modified byadjusting a quantization parameter.

In at least one implementation, the transform/quantization unit 6143 mayperform a scan of the matrix including the quantized transformcoefficients. Alternatively, the entropy encoding unit 6148 may performthe scan.

In at least one implementation, the entropy encoding unit 6148 mayreceive a plurality of syntax elements from the prediction process unit6141 and the transform/quantization unit 6143 including a quantizationparameter, transform data, motion vectors, intra modes, partitioninformation, and other syntax information. The entropy encoding unit6148 may encode the syntax elements into the bitstream.

In at least one implementation, the entropy encoding unit 6148 mayentropy encode the quantized transform coefficients by performing CAVLC,CABAC, SBAC, PIPE coding or another entropy coding technique to generatean encoded bitstream. The encoded bitstream may be transmitted toanother device (i.e., the second electronic device 120 in FIG. 1) orarchived for later transmission or retrieval.

In at least one implementation, the inverse quantization/inversetransform unit 6144 may apply inverse quantization and inversetransformation to reconstruct the residual block in the pixel domain forlater use as a reference block. The second summer 6145 may add thereconstructed residual block to the prediction block provided from theprediction process unit 6141 in order to produce a reconstructed blockfor storage in the decoded picture buffer 6147.

In at least one implementation, the filtering unit 6146 may include adeblocking filter, a SAO filter, a bilateral filter, and/or an ALF toremove blocking artifacts from the reconstructed block. Additionalfilters (in loop or post loop) may be used in addition to the deblockingfilter, the SAO filter, the bilateral filter and the ALF. Such filtersare not illustrated for brevity and may filter the output of the secondsummer 6145.

In at least one implementation, the decoded picture buffer 6147 may be areference picture memory that stores the reference block for use by theencoder module 114 to encode video, such as in intra or inter codingmodes. The decoded picture buffer 6147 may include a variety of memorydevices such as DRAM, including SDRAM, MRAM, RRAM), or other types ofmemory devices. The decoded picture buffer 6147 may be on-chip withother components of the encoder module 114 or off-chip relative to thosecomponents.

In at least one implementation, the encoder module 114 may perform themethod 300 for encoding a video and reconstructing a block unit asillustrated in FIG. 3. The method 300 may be performed using theconfigurations illustrated in FIG. 1 and FIG. 6 and various elements ofthese figures are referenced with regard to the method 300. Each blockillustrated in FIG. 3 may represent one or more processes, methods, orsubroutines performed.

The order of blocks in FIG. 3 is illustrative only and may change.Additional blocks may be added or less blocks may be utilized withoutdeparting from the present disclosure.

At block 310, an encoder module 114 receives an image frame of videodata. The video data may be video. With reference to FIGS. 1 and 6, thefirst electronic device 110 may receive the video via the source module112. The encoder module 114 may determine the image frame from thevideo.

At block 320, an encoder module 114 determines a block unit having ablock width and a block height from the received video data. Withreference to FIG. 1 and FIG. 6, the encoder module 114 may divide theimage frame to determine the block unit. In at least one implementation,the prediction process unit 6141 of the first electronic device 110 maydetermine the block unit from the video via the partition unit 61411 andthe encoder module 114 may provide a plurality of partition indicationsinto a bitstream based on a partition result of the partition unit61411. In the implementation, the encoder module 114 may divide theimage frames to generate a plurality of coding tree units and mayfurther divide one of the coding tree units to determine the block unit(e.g., based on a video coding standard). With reference to FIG. 4A-FIG.4C, the block height H410 is equal to the block width W410, the blockwidth W430 is equal to 8×H430 and the block height H450 is equal to4×W450.

At block 330, the encoder module 114 determines a comparison between theblock width and the block height. With reference to FIG. 1 and FIG. 6,the encoder module 114 may determine the comparison between the blockwidth and the block height based on an inequality. For example, a ratiovalue R between the block width Wb and the block height Hb is greaterthan or equal to a threshold value T (i.e., R≥T). The ratio value Rbetween the width Wb and the block height Hb may be less than thethreshold value T (i.e., R<T).

In at least one implementation, the encoder module 114 may determine aratio parameter RP computed based on the block width Wb and the blockheight Hb. In at least one implementation, a first ratio parameter RP1may be computed based on the block width Wb and the block height Hb bydivision. In one implementation, the first ratio parameter RP1 may becomputed by dividing the block width Wb by the block height Hb (i.e.,RP1=Wb/Hb) when the block width Wb is greater than or equal to the blockheight Hb. In the implementation, the first ratio parameter RP1 may becomputed by dividing the block height Hb by the block width Wb (i.e.,RP1=Hb/Wb) when the block width Wb is less than the block height Hb.

In at least one implementation, the second ratio parameter RP2 may becomputed based on the block width Wb and the block height Hb by alogarithmic equation. In the implementation, one of the first ratioparameter RP1 and the second ratio parameter RP2 computed by differentformulas may be set as the ratio parameter RP of the block unit. In atleast one implementation, the second ratio parameter RP2 may be equal toan absolute value of a difference value generated by subtracting abase-2 logarithm of the block height from a base-2 logarithm of theblock width (i.e., RP2=abs (log 2 Wb−log 2 Hb)). In the implementation,the first ratio parameter RP1 may be equal to two to the power of thesecond ratio parameter RP2.

In at least one implementation, the encoder module 114 may compare theratio parameter RP with a ratio threshold RT. In the implementation, theencoder module 114 may determine that the comparison indicates that theratio value R is greater than or equal to the threshold value T when theratio parameter RP is greater than or equal to the ratio threshold RT.The encoder module 114 may determine that the comparison indicates thatthe ratio value R is less than the threshold value T when the ratioparameter RP is less than the ratio threshold RT.

In at least one implementation, the encoder module 114 may compare theratio parameter RP with a first ratio threshold RT1 when the first ratioparameter RP1 is set as the ratio parameter RP. In at least oneimplementation, the encoder module 114 may compare the ratio parameterRP with a second ratio threshold RT2 when the second ratio parameter RP2is set as the ratio parameter RP.

In one implementation, the encoder module 114 may determine that thecomparison indicates that the ratio value R is greater than or equal tothe threshold value T when the first ratio parameter RP1 is greater thanor equal to the first ratio threshold RT1 or the second ratio parameterRP2 is greater than or equal to the second ratio threshold RT2. Theencoder module 114 may determine that the comparison indicates that theratio value R is less than the threshold value T when the first ratioparameter RP1 is less than the first ratio threshold RT1 or the secondratio parameter RP2 is less than the second ratio threshold RT2.

In at least one implementation, the first ratio threshold RT1 and thesecond ratio threshold RT2 may be a positive integer. In at least oneimplementation, the first ratio threshold RT1 may be equal to two to thepower of n, and the number n is a positive integer. The first ratiothreshold RT1 may be preset to 1, 2, 4 or 8, and the second ratiothreshold RT2 may be preset to 1, 2, 3 or 4.

In at least one implementation, the first ratio threshold RT1 may beequal to two to the power of the second ratio threshold RT2 since thefirst ratio parameter RP1 is equal to two to the power of the secondratio parameter RP2. Therefore, the result of the comparison may beunchanged when the encoder module 114 changes the comparison from afirst inequality RP1<RT1 to a second inequality RP2<RT2.

In at least one implementation, the encoder module 114 may compare theblock width Wb with a first magnified value N1 computed by multiplyingthe block height Hb by the threshold value T and compare the blockheight Hb with a second magnified value N2 computed by multiplying theblock width Wb by the threshold value T when the encoder module 114determines the comparison between the block width Wb and the blockheight Hb.

In at least one implementation, the encoder module 114 may determine thecomparison indicates that the ratio value R is less than the thresholdvalue T when the block width Wb is less than the first magnified valueN1 and the block height Hb is less than the second magnified value N2.In another implementation, the encoder module 114 may determine thecomparison indicates that the ratio value R is greater than or equal tothe threshold value T when the block width Wb is greater than or equalto the first magnified value N1 or the block height Hb is greater thanor equal to the second magnified value N2.

In at least one implementation, the threshold value T may be equal tothe first ratio threshold RT1 when the encoder module 114 determines thecomparison based on the first magnified value N1 and the secondmagnified value N2. The encoder module 114 may determine the comparisonbased on a third inequality Wb<N1=RT1×Hb and a fourth inequalityHb<N2=RT1×Wb.

In at least one implementation, the comparison determined based on thefirst inequality RP1=Wb/Hb<RT1 may be identical to the comparisondetermined based on the third inequality Wb<N1=RT1×Hb and the fourthinequality Hb<N2=RT1×Wb when the block width Wb is greater than theblock height Hb. The comparison determined based on the first inequalityRP1=Hb/Wb<RT1 may also be identical to the comparison determined basedon the third inequality Wb<N1=RT1×Hb and the fourth inequalityHb<N2=RT1×Wb when the block width Wb is less than the block height Hb.

At block 340, the encoder module 114 determines whether a geometricpartitioning mode is disabled for the block unit based on thecomparison. The method 300 may proceed to block 350 when the encodermodule 114 determines that the geometric partitioning mode is disabledfor the block unit. The method may proceed to block 360 when the encodermodule 114 determines the geometric partitioning mode is enabled for theblock unit.

With further reference to FIG. 1 and FIG. 6, the encoder module 114 maydetermine that the geometric partitioning mode is disabled for the blockunit when the comparison indicates that the ratio value R is greaterthan or equal to the threshold value T. The encoder module 114 maydetermine that the geometric partitioning mode is enabled for the blockunit when the comparison indicates that the ratio value R is less thanthe threshold value T.

At block 350, the encoder module 114 predicts the block unit by using afirst prediction mode different from the geometric partitioning mode togenerate a predicted block. With further reference to FIG. 1 and FIG. 6,the encoder module 114 may generate a plurality of coding resultsgenerated by the intra prediction unit 61412 and the inter predictionunit 61413. Then, the encoder module 114 may select one of the codingresults based on a mode selection method, such as a cost function. Themode selection method may be a rate-distortion optimization (RDO)process.

In at least one implementation, the encoder module 114 may select thefirst prediction mode from a plurality of option modes when thegeometric partitioning mode is disabled for the block unit. In theimplementation, the encoder module 114 may predict the block unit basedon the first prediction mode to generate the predicted block when thecomparison indicates that the ratio value R is greater than or equal tothe threshold value T. Each of the option modes is different from thegeometric partitioning mode. In at least one implementation, the optionmodes may include a plurality of merge candidate modes in a mergecandidate list.

At block 360, the encoder module 114 predicts the block unit by using asecond prediction mode selected from a plurality of candidate modesincluding the geometric partitioning mode to generate the predictedblock. With further reference to FIG. 1 and FIG. 6, the encoder module114 may generate the coding results generated by the intra predictionunit 61412 and the inter prediction unit 61413. Then, the encoder module114 may select one of the coding results based on the mode selectionmethod.

In at least one implementation, the encoder module 114 may select thesecond prediction mode from a plurality of candidate modes when thegeometric partitioning mode is enabled for the block unit. In theimplementation, the encoder module 114 may predict the block unit basedon the second prediction mode to generate the predicted block when thecomparison indicates that the ratio value R is less than the thresholdvalue T. In at least one implementation, the candidate modes may includethe option modes and the geometric partitioning modes.

At block 370, the encoder module 114 reconstructs the block unit basedon the predicted block. In at least one implementation, the block unitmay include a plurality of block elements. In the implementation, eachof the block elements may be a pixel element. With further reference toFIG. 1 and FIG. 6, the encoder module 114 may determine a plurality ofresidual components by subtracting the predicted block from the blockelements and provide the bitstream including a plurality of coefficientscorresponding to the residual components. The encoder module 114 mayreturn the residual components based on the coefficients, and add thereturned residual components into the predicted block to generate areconstructed block units.

The disclosed implementations are to be considered in all respects asillustrative and not restrictive. It should also be understood that thepresent disclosure is not limited to the specific disclosedimplementations but that many rearrangements, modifications, andsubstitutions are possible without departing from the scope of thepresent disclosure.

What is claimed is:
 1. A method of decoding a bitstream by an electronicdevice, the method comprising: receiving an image frame of thebitstream; determining a block unit having a block width and a blockheight from the received image frame; determining whether a geometricpartitioning mode is disabled for the block unit based on a comparisonbetween the block width and the block height, the block unit beingdivided to generate a plurality of sub-blocks predicted by differentmerge candidates of the block unit when the geometric partitioning modeis enabled and applied on the block unit; generating a predicted blockby predicting the block unit based on a prediction mode different fromthe geometric partitioning mode when the geometric partitioning mode isdisabled for the block unit; and reconstructing the block unit based onthe predicted block.
 2. The method according to claim 1, furthercomprising: determining that the geometric partitioning mode is disabledfor the block unit when the comparison between the block width and theblock height indicates that a ratio value between the block width andthe block height is greater than or equal to a threshold value; anddetermining that the geometric partitioning mode is not disabled whenthe comparison between the block width and the block height indicatesthat the ratio value is less than the threshold value.
 3. The methodaccording to claim 2, further comprising: determining a ratio parametergenerated based on the block width and the block height; comparing theratio parameter with a ratio threshold; determining that the comparisonbetween the block width and the block height indicates that the ratiovalue is greater than or equal to the threshold value when the ratioparameter is greater than or equal to the ratio threshold; anddetermining that the comparison between the block width and the blockheight indicates that the ratio value is less than the threshold valuewhen the ratio parameter is less than the ratio threshold.
 4. The methodaccording to claim 3, wherein: the ratio parameter is determined bydividing the block width by the block height when the block width isgreater than the block height, and the ratio parameter is determined bydividing the block height by the block width when the block height isgreater than or equal to the block width.
 5. The method according toclaim 3, wherein the ratio parameter is equal to an absolute value of adifference value generated by subtracting a base-2 logarithm of theblock height from a base-2 logarithm of the block width.
 6. The methodaccording to claim 2, further comprising: comparing the block width witha first magnified value generated by multiplying the block height by thethreshold value; comparing the block height with a second magnifiedvalue generated by multiplying the block width by the threshold value;determining that the comparison between the block width and the blockheight indicates that the ratio value is less than the threshold valuewhen the block width is less than the first magnified value and theblock height is less than the second magnified value; determining thatthe comparison between the block width and the block height indicatesthat the ratio value is greater than or equal to the threshold valuewhen the block width is greater than or equal to the first magnifiedvalue; and determining that the comparison between the block width andthe block height indicates that the ratio value is greater than or equalto the threshold value when the block height is greater than or equal tothe second magnified value.
 7. The method according to claim 1, furthercomprising: determining a partition index, a first merge index, and asecond merge index of the block unit when the block unit is predicted bythe geometric partitioning mode; dividing the block unit to generate afirst sub-block and a second sub-block based on the partition index; andpredicting the first sub-block by a first merge mode selected from aplurality of merge candidates based on the first merge index, andpredicting the second sub-block by a second merge mode selected from theplurality of merge candidates based on the second merge index togenerate the predicted block.
 8. A method of decoding a bitstream by anelectronic device, the method comprising: receiving an image frame ofthe bitstream; determining a block unit having a block width and a blockheight from the received image frame; determining a comparison betweenthe block width and the block height; generating a predicted block bypredicting the block unit based on a first prediction mode differentfrom a geometric partitioning mode when the comparison between the blockwidth and the block height indicates that a ratio value between theblock width and the block height is greater than or equal to a thresholdvalue, the block unit being divided to generate a plurality ofsub-blocks predicted by different merge candidates of the block unitwhen the geometric partitioning mode is enabled and applied on the blockunit; and reconstructing the block unit based on the predicted block. 9.The method according to claim 8, further comprising: determining a ratioparameter generated based on the block width and the block height;comparing the ratio parameter with a ratio threshold; and determiningthat the comparison between the block width and the block heightindicates that the ratio value is greater than or equal to the thresholdvalue when the ratio parameter is greater than or equal to the ratiothreshold.
 10. The method according to claim 9, wherein: the ratioparameter is determined by dividing the block width by the block heightwhen the block width is greater than the block height, and the ratioparameter is determined by dividing the block height by the block widthwhen the block height is greater than or equal to the block width. 11.The method according to claim 9, wherein the ratio parameter is equal toan absolute value of a difference value generated by subtracting abase-2 logarithm of the block height from a base-2 logarithm of theblock width.
 12. The method according to claim 9, further comprising:determining that the comparison between the block width and the blockheight indicates that the ratio value is less than the threshold valuewhen the ratio parameter is less than the ratio threshold; andgenerating the predicted block by predicting the block unit based on asecond prediction mode selected from a plurality of candidate modesincluding the geometric partitioning mode when the comparison betweenthe block width and the block height indicates that the ratio value isless than the threshold value.
 13. The method according to claim 8,further comprising: comparing the block width with a first magnifiedvalue generated by multiplying the block height by the threshold value;comparing the block height with a second magnified value generated bymultiplying the block width by the threshold value; determining that thecomparison between the block width and the block height indicates thatthe ratio value is greater than or equal to the threshold value when theblock width is greater than or equal to the first magnified value; anddetermining that the comparison between the block width and the blockheight indicates that the ratio value is greater than or equal to thethreshold value when the block height is greater than or equal to thesecond magnified value.
 14. The method according to claim 13, furthercomprising: determining that the comparison between the block width andthe block height indicates that the ratio value is less than thethreshold value when the block width is less than the first magnifiedvalue and the block height is less than the second magnified value; andpredicting the block unit to generate the predicted block by using asecond prediction mode selected from a plurality of candidate modesincluding the geometric partitioning mode when the comparison betweenthe block width and the block height represents that the ratio value isless than the threshold value.
 15. An electronic device for decoding abitstream, the electronic device comprising: at least one processor; anda storage device coupled to the at least one processor and storing aprogram which, when executed by the at least one processor, causes theelectronic device to: receive an image frame of the bitstream; determinea block unit having a block width and a block height from the receivedimage frame; determine a comparison between the block width and theblock height; generate a predicted block by predicting the block unitbased on a first prediction mode different from a geometric partitioningmode when the comparison between the block width and the block heightindicates that a ratio value between the block width and the blockheight is greater than or equal to a threshold value, wherein the blockunit is divided to generate a plurality of sub-blocks predicted bydifferent merge candidates of the block unit when the geometricpartitioning mode is enabled and applied on the block unit; andreconstruct the block unit based on the predicted block.
 16. Theelectronic device according to claim 15, wherein the program, whenexecuted by the at least one processor, further causes the electronicdevice to: determine a ratio parameter generated based on the blockwidth and the block height; compare the ratio parameter with a ratiothreshold; and determine that the comparison between the block width andthe block height indicates that the ratio value is greater than or equalto the threshold value when the ratio parameter is greater than or equalto the ratio threshold.
 17. The electronic device according to claim 16,wherein: the ratio parameter is determined by dividing the block widthby the block height when the block width is greater than the blockheight, and the ratio parameter is determined by dividing the blockheight by the block width when the block height is greater than or equalto the block width.
 18. The electronic device according to claim 16,wherein the ratio parameter is equal to an absolute value of adifference value generated by subtracting a base-2 logarithm of theblock height from a base-2 logarithm of the block width.
 19. Theelectronic device according to claim 16, wherein the program, whenexecuted by the at least one processor, further causes the electronicdevice to: determine that the comparison between the block width and theblock height indicates that the ratio value is less than the thresholdvalue when the ratio parameter is less than the ratio threshold; andgenerate the predicted block by predicting the block unit based on asecond prediction mode selected from a plurality of candidate modesincluding the geometric partitioning mode when the comparison betweenthe block width and the block height represents that the ratio value isless than the threshold value.
 20. The electronic device according toclaim 15, wherein the program, when executed by the at least oneprocessor, further causes the electronic device to: compare the blockwidth with a first magnified value generated by multiplying the blockheight by the threshold value; compare the block height with a secondmagnified value generated by multiplying the block width by thethreshold value; determine that the comparison between the block widthand the block height indicates that the ratio value is greater than orequal to the threshold value when the block width is greater than orequal to the first magnified value; determine that the comparisonbetween the block width and the block height indicates that the ratiovalue is greater than or equal to the threshold value when the blockheight is greater than or equal to the second magnified value; determinethat the comparison between the block width and the block heightindicates that the ratio value is less than the threshold value when theblock width is less than the first magnified value and the block heightis less than the second magnified value; and generate the predictedblock by predicting the block unit based on a second prediction modeselected from a plurality of candidate modes including the geometricpartitioning mode when the comparison between the block width and theblock height indicates that the ratio value is less than the thresholdvalue.